﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Utils.Extention;
#region Version Info
/* ========================================================================
* 【本页面功能概述】
*
* 作者：wangjianfeng 创建时间：2012/9/19 11:31:20
* 文件名：Right.cs
*
* 修改者： 时间：
* 修改说明：
* ========================================================================
*/
#endregion
namespace ChinaLeg.Web.UserControls
{
    public partial class Right : System.Web.UI.UserControl
    {
        private int size = 4;
        public int Size { set { size = value; } }
        public int Height { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                string key = string.Format("RightPic_{0}",size);
                List<ChinaLeg.Model.CaseShow> list = null;
                if (Cache[key] == null)
                {
                    list = ChinaLeg.BLL.CaseShow.Instance.GetList(" and catid=49 ", size, "ShowOrder", 0);
                    Cache.Insert(key, list, null, DateTime.Now.AddHours(1), TimeSpan.Zero);
                }
                else
                {
                    list = Cache[key] as List<ChinaLeg.Model.CaseShow>;
                }
                rpt.DataSource = list;
                rpt.DataBind();
            }
        }
    }
}